/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 殇
 * Date: 2025-07-26
 * Time: 9:57
 */
public class MyQueue {
    private static class Node{
        int val;
        Node prev;
        Node next;

        public Node(int val) {
            this.val = val;
        }
    }
    Node head;
    Node tail;

    //入队列 => 尾插
    public boolean offer(int val){
        Node node=new Node(val);
        if(head==null){
            head=node;
            tail=node;
        }
        else{
            node.prev=tail;
            tail.next=node;
            tail=node;
        }
    }
}
